package com.leetcode.LC;

public class LC1539 {
    public int findKthPositive(int[] arr, int k) {

        int a = 0, count = 0;
        for (int i = 1; i <= arr.length + k; i++) {
            if (i != arr[a]) {
                count++;
                if (count == k) {
                    return i;
                }
            } else {
                if (a + 1 != arr.length) {
                    a++;
                }
            }
        }
        return -1;
    }
}
